home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / webshell / nsILinkHandler.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  145 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37. #ifndef nsILinkHandler_h___
  38. #define nsILinkHandler_h___
  39.  
  40. #include "nsISupports.h"
  41.  
  42. class nsIInputStream;
  43. class nsIDocShell;
  44. class nsIRequest;
  45. class nsIContent;
  46. class nsString;
  47. class nsGUIEvent;
  48.  
  49. // Interface ID for nsILinkHandler
  50. #define NS_ILINKHANDLER_IID \
  51.  { 0xa6cf905b, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
  52.  
  53. enum nsLinkState {
  54.   eLinkState_Unknown    = 0,
  55.   eLinkState_Unvisited  = 1,
  56.   eLinkState_Visited    = 2, 
  57.   eLinkState_NotLink    = 3
  58. };
  59.  
  60. // XXX Verb to use for link actuation. These are the verbs specified
  61. // in the current XLink draft. We may actually want to support more
  62. // (especially for extended links).
  63. enum nsLinkVerb {
  64.   eLinkVerb_Replace = 0,
  65.   eLinkVerb_New     = 1,
  66.   eLinkVerb_Embed   = 2,
  67.   eLinkVerb_Undefined = 3
  68. };
  69.  
  70. /**
  71.  * Interface used for handling clicks on links
  72.  */
  73. class nsILinkHandler : public nsISupports {
  74. public:
  75.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID)
  76.  
  77.   /**
  78.    * Process a click on a link.
  79.    *
  80.    * @param aContent the content for the frame that generated the trigger
  81.    * @param aVerb the verb to use when the link is triggered
  82.    * @param aURI a URI object that defines the destination for the link
  83.    * @param aTargetSpec indicates where the link is targeted (may be an empty
  84.    *        string)
  85.    * @param aPostDataStream the POST data to send
  86.    * @param aHeadersDataStream ???
  87.    */
  88.   NS_IMETHOD OnLinkClick(nsIContent* aContent, 
  89.                          nsLinkVerb aVerb,
  90.                          nsIURI* aURI,
  91.                          const PRUnichar* aTargetSpec,
  92.                          nsIInputStream* aPostDataStream = 0,
  93.                          nsIInputStream* aHeadersDataStream = 0) = 0;
  94.  
  95.   /**
  96.    * Process a click on a link.
  97.    *
  98.    * Works the same as OnLinkClick() except it happens immediately rather than
  99.    * through an event.
  100.    *
  101.    * @param aContent the content for the frame that generated the trigger
  102.    * @param aVerb the verb to use when the link is triggered
  103.    * @param aURI a URI obect that defines the destination for the link
  104.    * @param aTargetSpec indicates where the link is targeted (may be an empty
  105.    *        string)
  106.    * @param aPostDataStream the POST data to send
  107.    * @param aHeadersDataStream ???
  108.    * @param aDocShell (out-param) the DocShell that the request was opened on
  109.    * @param aRequest the request that was opened
  110.    */
  111.   NS_IMETHOD OnLinkClickSync(nsIContent* aContent, 
  112.                              nsLinkVerb aVerb,
  113.                              nsIURI* aURI,
  114.                              const PRUnichar* aTargetSpec,
  115.                              nsIInputStream* aPostDataStream = 0,
  116.                              nsIInputStream* aHeadersDataStream = 0,
  117.                              nsIDocShell** aDocShell = 0,
  118.                              nsIRequest** aRequest = 0) = 0;
  119.  
  120.   /**
  121.    * Process a mouse-over a link.
  122.    *
  123.    * @param aContent the linked content.
  124.    * @param aURI an URI object that defines the destination for the link
  125.    * @param aTargetSpec indicates where the link is targeted (it may be an empty
  126.    *        string)
  127.    */
  128.   NS_IMETHOD OnOverLink(nsIContent* aContent, 
  129.                         nsIURI* aURLSpec,
  130.                         const PRUnichar* aTargetSpec) = 0;
  131.  
  132.   /**
  133.    * Process the mouse leaving a link.
  134.    */
  135.   NS_IMETHOD OnLeaveLink() = 0;
  136.       
  137.  
  138.   /**
  139.    * Get the state of a link to a given absolute URL
  140.    */
  141.   NS_IMETHOD GetLinkState(nsIURI* aLinkURI, nsLinkState& aState) = 0;
  142. };
  143.  
  144. #endif /* nsILinkHandler_h___ */
  145.